import App from './App'
import store from './store/index.js'
import {
  $http
} from '@escook/request-miniprogram'

uni.$http = $http
//基地址
$http.baseUrl = 'https://api-hmugo-web.itheima.net'

//请求拦截器
$http.beforeRequest = () => {
  uni.showLoading({
    title: '数据加载中...'
  })
}
$http.afterRequest = () => {
  uni.hideLoading()
}
//全局提示

uni.$showMsg = function(title = '出错啦', duration = 2000) {
  uni.showToast({
    title: title,
    icon: 'error',
    duration: duration
  })
}
// #ifndef VUE3
import Vue from 'vue'
Vue.config.productionTip = false
App.mpType = 'app'
const app = new Vue({
  ...App,
  store
})
app.$mount()
// #endif

// #ifdef VUE3
import {
  createSSRApp
} from 'vue'
export function createApp() {
  const app = createSSRApp(App)
  return {
    app
  }
}
// #endif
